import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wangxin
 * Date: 2024-08-14
 * Time: 20:12
 */
public class Demo8 {
    public static void main(String[] args) {
        File f = new File("text3.txt");
        System.out.println(f.exists());
        try(InputStream inputStream = new FileInputStream("text3.txt")){
            try(Scanner scanner = new Scanner(inputStream,"UTF-8")){
                while(scanner.hasNext()){
                    String s = scanner.next();
                    System.out.println(s);
                }
            }
        }catch(IOException e){
            e.printStackTrace();
        }
    }
}
